package com.cloudlead.fleetAction.action;

import com.cloudlead.common.lang.annotation.Label;
import com.cloudlead.common.worker.action.impl.AbstractActionFactory;
import com.cloudlead.common.worker.annotation.Action;
import com.cloudlead.common.worker.annotation.Order;
import com.cloudlead.fleetAction.BusinessModules;
import com.cloudlead.fleetAction.service.BaseDockEditSer;
import com.cloudlead.fleetService.BaseDockEditService;
import com.cloudlead.fleetService.vo.BaseDockCreateVo;
import com.cloudlead.fleetService.vo.BaseDockVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * Created by wyj on 2015/8/18.
 */
@Controller
public class BaseDockEditActionFactory extends AbstractActionFactory implements BaseDockEditService {
    public BaseDockEditActionFactory() {
        super(BusinessModules.DockManagement);
    }

    @Autowired
    BaseDockEditSer  baseDockEditSer;

    @Override
    @Action
    @Order(1)
    @Label("码头创建")
    public String createDock(@NotNull @Label("基本信息")BaseDockCreateVo cvo) {
        return baseDockEditSer.createDock(cvo);
    }

    @Override
    @Action
    @Order(2)
    @Label("码头列表查询")
    public List<BaseDockVo> findAllDock(@NotNull @Label("查询条件") BaseDockVo vo) {
        return baseDockEditSer.findAllDock(vo);
    }

    @Override
    @Action
    @Order(3)
    @Label("码头删除")
    public String delDock(@NotNull @Label("码头ID")String id) {
        return baseDockEditSer.delDock(id);
    }

    @Override
    @Action
    @Order(4)
    @Label("码头编辑")
    public String editDock(BaseDockVo vo) {
        return baseDockEditSer.editDock(vo);
    }

    @Override
    @Action
    @Order(5)
    @Label("码头增加")
    public String addDock(BaseDockVo vo){
        return baseDockEditSer.addDock(vo);
    }
}
